
<?php
//MAIN FORM CLASS. ALWAYS BEING USED, INDIRECTLY.
/**
 * Registration Form
 * This form would allow users of the system register with the system
 *
 */


 class Student_Form_NewCourse extends Zend_Dojo_Form
 {

     protected $_name = 'student_course';

	public function __construct($options = null)
		{
		parent::__construct($options);
		Zend_Dojo::enableForm($this);
		$this->setName('NewCourse');
		//$id = new Zend_Form_Element_Hidden('id');

		//User enters his First Name
		$CourseName = new Zend_Dojo_Form_Element_ValidationTextBox('course_name');
		$CourseName->setLabel('Course Name :')
		->setRequired(true)
		->addFilter('StripTags')
		->addFilter('StringTrim')
		->addValidator('NotEmpty');

                $CourseNumber = new Zend_Dojo_Form_Element_ValidationTextBox('course_number');
		$CourseNumber->setLabel('Course Number (Example COS 420) :')
		->setRequired(true)
		->addFilter('StripTags')
		->addFilter('StringTrim')
                ->addFilter('StringToUpper')
		->addValidator('NotEmpty');





                $coptions = (array ("1" => "1",
		     "2" => "2",
		     "3" => "3",
		     "4" => "4",
		     "5" => "5",
                     "6" => "6" ));
                $CourseCredits = new Zend_Dojo_Form_Element_ComboBox('course_credits');
                $CourseCredits->setLabel('Number of credits:');
                $CourseCredits->addMultiOptions($coptions);
                $CourseCredits->setAutocomplete(true);

                $groptions = (array ("A" => "A",
		     "A-" => "A-",
		     "B+" => "B+",
		     "B" => "B",
		     "B-" => "B-",
                     "C+" => "C+",
                     "C" => "C",
                     "C-" => "C-",
                     "D+" => "D+",
                     "D" => "D",
                     "D-" => "D-"));
                $desired_grade = new Zend_Dojo_Form_Element_ComboBox('desired_grade');
                $desired_grade->setLabel('Desired Grade: ');
                $desired_grade->addMultiOptions($groptions);
                $desired_grade->setAutocomplete(true);


                $soptions = (array ("Fall" => "Fall",
		     "Spring" => "Spring",
		     "Summer" => "Summer",
		      ));
                $semester = new Zend_Dojo_Form_Element_ComboBox('semester');
                $semester->setLabel('Semester:');
                $semester->addMultiOptions($soptions);
                $semester->setAutocomplete(true);


                $yoptions = (array ("1999" => "1999",
		     "2000" => "2000",
		     "2001" => "2001",
                    "2002" => "2002",
                    "2003" => "2003",
                    "2004" => "2004",
                    "2005" => "2005",
                    "2006" => "2006",
                    "2007" => "2007",
                    "2008" => "2008",
                    "2009" => "2009",
                    "2010" => "2010",
                    "2011" => "2011",


		      ));
                $year = new Zend_Dojo_Form_Element_ComboBox('year');
                $year->setLabel('Year');
                $year->addMultiOptions($yoptions);
                $year->setAutocomplete(true);


		$submit = new Zend_Dojo_Form_Element_SubmitButton('Submit');

		$this->addElements(array($CourseName, $CourseNumber,$CourseCredits, $desired_grade, $semester, $year));
	    $this->addElement($submit);
		//$this->setAction('register');
		$this->setMethod('POST');
		}
}



